<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.4"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Flow-IPC: transport/struc/heap_serializer.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">Flow-IPC<span id="projectnumber">&#160;1.0.2</span>
   </div>
   <div id="projectbrief">Flow-IPC project: Full implementation reference.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_58e412aa7ace8e71fc01678dc8765e7c.html">transport</a></li><li class="navelem"><a class="el" href="dir_a98fddea045b8b2df4350ebb1d483bf8.html">struc</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle"><div class="title">heap_serializer.cpp</div></div>
</div><!--header-->
<div class="contents">
<a href="heap__serializer_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span><span class="comment">/* Flow-IPC: Structured Transport</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno">    2</span><span class="comment"> * Copyright (c) 2023 Akamai Technologies, Inc.; and other contributors.</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno">    3</span><span class="comment"> * Each commit is copyright by its respective author or author&#39;s employer.</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno">    4</span><span class="comment"> *</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno">    5</span><span class="comment"> * Licensed under the MIT License:</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno">    6</span><span class="comment"> *</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno">    7</span><span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a copy</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span><span class="comment"> * of this software and associated documentation files (the &quot;Software&quot;), to deal</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span><span class="comment"> * in the Software without restriction, including without limitation the rights</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span><span class="comment"> * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span><span class="comment"> * copies of the Software, and to permit persons to whom the Software is</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span><span class="comment"> * furnished to do so, subject to the following conditions:</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span><span class="comment"> *</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span><span class="comment"> * The above copyright notice and this permission notice shall be included in</span></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span><span class="comment"> * all copies or substantial portions of the Software.</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span><span class="comment"> *</span></div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span><span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno">   18</span><span class="comment"> * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span></div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno">   19</span><span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span></div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno">   20</span><span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span></div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno">   21</span><span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span></div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno">   22</span><span class="comment"> * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN</span></div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span><span class="comment"> * THE SOFTWARE. */</span></div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno">   24</span><span class="comment"></span> </div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno">   25</span><span class="comment">/// @file</span></div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno">   26</span><span class="comment"></span> </div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno">   27</span><span class="preprocessor">#include &quot;<a class="code" href="heap__serializer_8hpp.html">ipc/transport/struc/heap_serializer.hpp</a>&quot;</span></div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno">   28</span><span class="preprocessor">#include &lt;boost/move/make_unique.hpp&gt;</span></div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno">   29</span> </div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno">   30</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespaceipc_1_1transport_1_1struc.html">ipc::transport::struc</a></div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno">   31</span>{</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno">   32</span> </div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno">   33</span><span class="comment">// Static initializers.</span></div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno">   34</span> </div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"><a class="line" href="namespaceipc_1_1transport_1_1struc.html#ac70446757444f864afa21a5062bc5b0d">   35</a></span><span class="keyword">const</span> <a class="code hl_struct" href="structipc_1_1transport_1_1struc_1_1Null__session.html">Null_session</a> <a class="code hl_variable" href="namespaceipc_1_1transport_1_1struc.html#ac70446757444f864afa21a5062bc5b0d">NULL_SESSION</a>;</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno">   36</span> </div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno">   37</span><span class="comment">// Heap_fixed_builder implementations.</span></div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno">   38</span> </div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno">   39</span><a class="code hl_function" href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder.html#a6debedf2ddfff80f269d296c24686add">Heap_fixed_builder::Heap_fixed_builder</a>() = <span class="keywordflow">default</span>;</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno">   40</span> </div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"><a class="line" href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder.html#ac18c78936dffe8edb5990c4222e78fa5">   41</a></span><a class="code hl_function" href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder.html#a6debedf2ddfff80f269d296c24686add">Heap_fixed_builder::Heap_fixed_builder</a>(<span class="keyword">const</span> <a class="code hl_struct" href="structipc_1_1transport_1_1struc_1_1Heap__fixed__builder_1_1Config.html">Config</a>&amp; config) :</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno">   42</span>  flow::log::Log_context(config.m_logger_ptr, <a class="code hl_enumeration" href="namespaceipc.html#a4ccdeed058222c635745a4dc830e99f7">Log_component</a>::S_TRANSPORT),</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno">   43</span> </div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno">   44</span>  m_segment_sz(config.m_segment_sz),</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno">   45</span>  <span class="comment">// The builder engine launched here.  In the future mutators will cause it to allocate in heap on-demand.</span></div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno">   46</span>  m_engine(boost::movelib::make_unique&lt;<a class="code hl_class" href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder__capnp__message__builder.html">Capnp_heap_engine</a>&gt;</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno">   47</span>             (get_logger(),</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno">   48</span>              config.m_segment_sz, config.m_frame_prefix_sz, config.m_frame_postfix_sz))</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno">   49</span>{</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno">   50</span>  FLOW_LOG_TRACE(<span class="stringliteral">&quot;Heap_fixed_builder [&quot;</span> &lt;&lt; *<span class="keyword">this</span> &lt;&lt; <span class="stringliteral">&quot;]: Fixed-size builder started: &quot;</span></div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno">   51</span>                 <span class="stringliteral">&quot;segment size limit [&quot;</span> &lt;&lt; <a class="code hl_variable" href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder.html#afa719b263e06eb7359b948a36f251485">m_segment_sz</a> &lt;&lt; <span class="stringliteral">&quot;].&quot;</span>);</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno">   52</span>  assert(<a class="code hl_variable" href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder.html#afa719b263e06eb7359b948a36f251485">m_segment_sz</a> != 0);</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno">   53</span>}</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno">   54</span> </div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno">   55</span><a class="code hl_function" href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder.html#a6debedf2ddfff80f269d296c24686add">Heap_fixed_builder::Heap_fixed_builder</a>(<a class="code hl_class" href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder.html">Heap_fixed_builder</a>&amp;&amp;) = <span class="keywordflow">default</span>;</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno">   56</span> </div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"><a class="line" href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder.html#aa670a6356fe677ae5b1e629a3964b355">   57</a></span><a class="code hl_function" href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder.html#aa670a6356fe677ae5b1e629a3964b355">Heap_fixed_builder::~Heap_fixed_builder</a>()</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno">   58</span>{</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno">   59</span>  FLOW_LOG_TRACE(<span class="stringliteral">&quot;Heap_fixed_builder [&quot;</span> &lt;&lt; *<span class="keyword">this</span> &lt;&lt; <span class="stringliteral">&quot;]: Fixed-size builder being destroyed.&quot;</span>);</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno">   60</span>  <span class="comment">// @todo Maybe have Heap_fixed_builder_capnp_message_builder log something useful in its dtor?</span></div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno">   61</span>}</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno">   62</span> </div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno">   63</span><a class="code hl_class" href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder.html">Heap_fixed_builder</a>&amp; <a class="code hl_function" href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder.html#ad1f2df842a49ea376749893af71a7a07">Heap_fixed_builder::operator=</a>(<a class="code hl_class" href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder.html">Heap_fixed_builder</a>&amp;&amp;) = <span class="keywordflow">default</span>;</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno">   64</span> </div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"><a class="line" href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder.html#a0c054e351753ce326620aa1dec12d923">   65</a></span><a class="code hl_class" href="classCapnp__msg__builder__interface.html">Capnp_msg_builder_interface</a>* <a class="code hl_function" href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder.html#a0c054e351753ce326620aa1dec12d923">Heap_fixed_builder::payload_msg_builder</a>()</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno">   66</span>{</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno">   67</span>  assert(<a class="code hl_variable" href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder.html#a8f8e07a71aa5e47d6b8094b2a004cc7d">m_engine</a> &amp;&amp; <span class="stringliteral">&quot;Are you operating on a moved-from `*this`?&quot;</span>);</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno">   68</span> </div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno">   69</span>  <span class="keywordflow">return</span> <a class="code hl_variable" href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder.html#a8f8e07a71aa5e47d6b8094b2a004cc7d">m_engine</a>.get();</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno">   70</span>}</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno">   71</span> </div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"><a class="line" href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder.html#a9fb6b2727c7cc0fb8fe7d231385b5517">   72</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder.html#a9fb6b2727c7cc0fb8fe7d231385b5517">Heap_fixed_builder::emit_serialization</a>(<a class="code hl_typedef" href="namespaceipc_1_1transport_1_1struc.html#a82a69eaa39cbe8a002de1266f1cbb5cb">Segment_ptrs</a>* target_blobs, [[maybe_unused]] <span class="keyword">const</span> <a class="code hl_struct" href="structipc_1_1transport_1_1struc_1_1Null__session.html">Session</a>&amp; session,</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno">   73</span>                                            <a class="code hl_typedef" href="namespaceipc.html#aa3192e586cc45d3e7c22463bf2760f89">Error_code</a>* err_code)<span class="keyword"> const</span></div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno">   74</span><span class="keyword"></span>{</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno">   75</span>  <span class="keyword">using </span><a class="code hl_typedef" href="namespaceipc_1_1util.html#ae0be7edba7e30ffa3f8b742af621f2ab">util::Blob_const</a>;</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno">   76</span> </div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno">   77</span>  <span class="keywordflow">if</span> (flow::error::exec_void_and_throw_on_error</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno">   78</span>        ([&amp;](<a class="code hl_typedef" href="namespaceipc.html#aa3192e586cc45d3e7c22463bf2760f89">Error_code</a>* actual_err_code) { <a class="code hl_function" href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder.html#a9fb6b2727c7cc0fb8fe7d231385b5517">emit_serialization</a>(target_blobs, session, actual_err_code); },</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno">   79</span>         err_code, <span class="stringliteral">&quot;Heap_fixed_builder::emit_serialization()&quot;</span>))</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno">   80</span>  {</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno">   81</span>    <span class="keywordflow">return</span>;</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno">   82</span>  }</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno">   83</span>  <span class="comment">// If got here: err_code is not null.</span></div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno">   84</span> </div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno">   85</span>  assert(<a class="code hl_variable" href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder.html#a8f8e07a71aa5e47d6b8094b2a004cc7d">m_engine</a> &amp;&amp; <span class="stringliteral">&quot;Are you operating on a moved-from `*this`?&quot;</span>);</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno">   86</span> </div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno">   87</span>  <span class="comment">/* Reminder: concept API says emit_serialization() can be called &gt;1 times.  We do allow that in the below.</span></div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno">   88</span><span class="comment">   * Keep in mind that mutations can be executed in-between, so whatever caching for perf one imagines has</span></div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno">   89</span><span class="comment">   * to not mess up in the face of that. */</span></div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno">   90</span> </div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno">   91</span>  <a class="code hl_typedef" href="namespaceipc_1_1transport_1_1struc.html#a82a69eaa39cbe8a002de1266f1cbb5cb">Segment_ptrs</a>&amp; blob_ptrs = *target_blobs;</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno">   92</span> </div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno">   93</span>  <span class="keywordtype">size_t</span> n_blobs = blob_ptrs.size();</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno">   94</span>  <a class="code hl_variable" href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder.html#a8f8e07a71aa5e47d6b8094b2a004cc7d">m_engine</a>-&gt;emit_segment_blobs(&amp;blob_ptrs); <span class="comment">// It appends, like we must.  Just be careful in remembering that below.</span></div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno">   95</span>  n_blobs = blob_ptrs.size() - n_blobs;</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno">   96</span>  assert((n_blobs &gt; 0) &amp;&amp; <span class="stringliteral">&quot;Empty serialization?  What went wrong?&quot;</span>);</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno">   97</span> </div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno">   98</span>  <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> abs_idx = blob_ptrs.size() - n_blobs, idx = 0;</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno">   99</span>       idx != n_blobs;</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno">  100</span>       ++abs_idx, ++idx)</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno">  101</span>  {</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno">  102</span>    <span class="keyword">const</span> <span class="keyword">auto</span> blob = blob_ptrs[abs_idx];</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno">  103</span>    <span class="keyword">const</span> <span class="keyword">auto</span> seg_size = blob-&gt;size();</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno">  104</span> </div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno">  105</span>    FLOW_LOG_TRACE(<span class="stringliteral">&quot;Heap_fixed_builder [&quot;</span> &lt;&lt; *<span class="keyword">this</span> &lt;&lt; <span class="stringliteral">&quot;]: &quot;</span></div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno">  106</span>                   <span class="stringliteral">&quot;Serialization segment [&quot;</span> &lt;&lt; idx &lt;&lt; <span class="stringliteral">&quot;] (0 based, of [&quot;</span> &lt;&lt; n_blobs &lt;&lt; <span class="stringliteral">&quot;], 1-based): &quot;</span></div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno">  107</span>                   <span class="stringliteral">&quot;Heap buffer @[&quot;</span> &lt;&lt; <span class="keyword">static_cast&lt;</span><span class="keyword">const </span><span class="keywordtype">void</span>*<span class="keyword">&gt;</span>(blob-&gt;begin()) &lt;&lt; <span class="stringliteral">&quot;] sized [&quot;</span> &lt;&lt; seg_size &lt;&lt; <span class="stringliteral">&quot;].&quot;</span>);</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno">  108</span> </div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno">  109</span>    <span class="comment">// Check for the one error condition: a too-large segment.</span></div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno">  110</span>    <span class="keywordflow">if</span> (seg_size &gt; <a class="code hl_variable" href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder.html#afa719b263e06eb7359b948a36f251485">m_segment_sz</a>)</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno">  111</span>    {</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno">  112</span>      FLOW_LOG_WARNING(<span class="stringliteral">&quot;Heap_fixed_builder [&quot;</span> &lt;&lt; *<span class="keyword">this</span> &lt;&lt; <span class="stringliteral">&quot;]: &quot;</span></div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno">  113</span>                       <span class="stringliteral">&quot;Serialization segment [&quot;</span> &lt;&lt; idx &lt;&lt; <span class="stringliteral">&quot;] (0 based, of [&quot;</span> &lt;&lt; n_blobs &lt;&lt; <span class="stringliteral">&quot;], 1-based): &quot;</span></div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno">  114</span>                       <span class="stringliteral">&quot;Heap buffer @[&quot;</span> &lt;&lt; <span class="keyword">static_cast&lt;</span><span class="keyword">const </span><span class="keywordtype">void</span>*<span class="keyword">&gt;</span>(blob-&gt;begin()) &lt;&lt; <span class="stringliteral">&quot;] &quot;</span></div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno">  115</span>                       <span class="stringliteral">&quot;sized [&quot;</span> &lt;&lt; seg_size &lt;&lt; <span class="stringliteral">&quot;]: exceeded limit &quot;</span></div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno">  116</span>                       <span class="stringliteral">&quot;[&quot;</span> &lt;&lt; <a class="code hl_variable" href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder.html#afa719b263e06eb7359b948a36f251485">m_segment_sz</a> &lt;&lt; <span class="stringliteral">&quot;].  Emitting error; will not return serialization.&quot;</span>);</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno">  117</span>      *err_code = <a class="code hl_enumvalue" href="namespaceipc_1_1transport_1_1struc_1_1error.html#a990b9ff850cf9aaf354efdd07d86a71da3deddc950bfa6d35ae03c9494eec15a6">error::Code::S_INTERNAL_ERROR_SERIALIZE_LEAF_TOO_BIG</a>;</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno">  118</span>      <span class="keywordflow">return</span>;</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno">  119</span>    }</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno">  120</span>    <span class="comment">// else</span></div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno">  121</span>  } <span class="comment">// for (blob : blob_ptrs, starting from first appended one)</span></div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno">  122</span>  <span class="comment">// Got here: no error.  Done and done.</span></div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno">  123</span>} <span class="comment">// Heap_fixed_builder::emit_serialization()</span></div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno">  124</span> </div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"><a class="line" href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder.html#a0f8b3c876c577aa0550d13faa60e30d2">  125</a></span><span class="keywordtype">size_t</span> <a class="code hl_function" href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder.html#a0f8b3c876c577aa0550d13faa60e30d2">Heap_fixed_builder::n_serialization_segments</a>()<span class="keyword"> const</span></div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno">  126</span><span class="keyword"></span>{</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno">  127</span>  assert(<a class="code hl_variable" href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder.html#a8f8e07a71aa5e47d6b8094b2a004cc7d">m_engine</a> &amp;&amp; <span class="stringliteral">&quot;Are you operating on a moved-from `*this`?&quot;</span>);</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno">  128</span> </div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno">  129</span>  <span class="keywordflow">return</span> <a class="code hl_variable" href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder.html#a8f8e07a71aa5e47d6b8094b2a004cc7d">m_engine</a>-&gt;n_segments();</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno">  130</span>}</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno">  131</span> </div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"><a class="line" href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder.html#ae272f248d74db0486c4d9411715db15d">  132</a></span>std::ostream&amp; <a class="code hl_function" href="namespaceipc_1_1transport_1_1struc.html#ae272f248d74db0486c4d9411715db15d">operator&lt;&lt;</a>(std::ostream&amp; os, <span class="keyword">const</span> <a class="code hl_class" href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder.html">Heap_fixed_builder</a>&amp; val)</div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno">  133</span>{</div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno">  134</span>  <span class="keywordflow">return</span> os &lt;&lt; <span class="charliteral">&#39;@&#39;</span> &lt;&lt; &amp;val;</div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno">  135</span>}</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno">  136</span> </div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno">  137</span><span class="comment">// Heap_reader implementations.</span></div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno">  138</span> </div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"><a class="line" href="classipc_1_1transport_1_1struc_1_1Heap__reader.html#a2dd5635aa61c4d562427b32a1266bac1">  139</a></span><a class="code hl_function" href="classipc_1_1transport_1_1struc_1_1Heap__reader.html#a2dd5635aa61c4d562427b32a1266bac1">Heap_reader::Heap_reader</a>(<span class="keyword">const</span> <a class="code hl_struct" href="structipc_1_1transport_1_1struc_1_1Heap__reader_1_1Config.html">Config</a>&amp; config) :</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno">  140</span>  flow::log::Log_context(config.m_logger_ptr, <a class="code hl_enumeration" href="namespaceipc.html#a4ccdeed058222c635745a4dc830e99f7">Log_component</a>::S_TRANSPORT)</div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno">  141</span>{</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno">  142</span>  FLOW_LOG_TRACE(<span class="stringliteral">&quot;Heap_reader [&quot;</span> &lt;&lt; *<span class="keyword">this</span> &lt;&lt; <span class="stringliteral">&quot;]: Heap reader started: &quot;</span></div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno">  143</span>                 <span class="stringliteral">&quot;expecting [&quot;</span> &lt;&lt; config.<a class="code hl_variable" href="structipc_1_1transport_1_1struc_1_1Heap__reader_1_1Config.html#aad4ca0248c1ac0c869ab6033d1d43bed">m_n_segments_est</a> &lt;&lt; <span class="stringliteral">&quot;] segments (0 if unknown).&quot;</span>);</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno">  144</span>  <a class="code hl_variable" href="classipc_1_1transport_1_1struc_1_1Heap__reader.html#a86d1fba98bf24c390587893c61174111">m_serialization_segments</a>.reserve(config.<a class="code hl_variable" href="structipc_1_1transport_1_1struc_1_1Heap__reader_1_1Config.html#aad4ca0248c1ac0c869ab6033d1d43bed">m_n_segments_est</a>);</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno">  145</span>}</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno">  146</span> </div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"><a class="line" href="classipc_1_1transport_1_1struc_1_1Heap__reader.html#a88e0a260e09275c1017719028288e413">  147</a></span><a class="code hl_function" href="classipc_1_1transport_1_1struc_1_1Heap__reader.html#a88e0a260e09275c1017719028288e413">Heap_reader::~Heap_reader</a>()</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno">  148</span>{</div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno">  149</span>  <span class="keywordflow">if</span> (!<a class="code hl_variable" href="classipc_1_1transport_1_1struc_1_1Heap__reader.html#ab56a232e71b862b8f498d04e04450b72">m_engine</a>)</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno">  150</span>  {</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno">  151</span>    FLOW_LOG_TRACE(<span class="stringliteral">&quot;Heap_reader [&quot;</span> &lt;&lt; *<span class="keyword">this</span> &lt;&lt; <span class="stringliteral">&quot;]: Reader being destroyed including: &quot;</span></div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno">  152</span>                   <span class="stringliteral">&quot;serialization containing [&quot;</span> &lt;&lt; <a class="code hl_variable" href="classipc_1_1transport_1_1struc_1_1Heap__reader.html#a86d1fba98bf24c390587893c61174111">m_serialization_segments</a>.size() &lt;&lt; <span class="stringliteral">&quot;] segments; &quot;</span></div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno">  153</span>                   <span class="stringliteral">&quot;no deserialization yet attempted.&quot;</span>);</div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno">  154</span>  }</div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno">  155</span>  <span class="keywordflow">else</span></div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno">  156</span>  {</div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno">  157</span>    <span class="comment">// This *might* be perf-pricey, to some extent, so definitely be careful with the log level.</span></div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno">  158</span>    FLOW_LOG_TRACE(<span class="stringliteral">&quot;Heap_reader [&quot;</span> &lt;&lt; *<span class="keyword">this</span> &lt;&lt; <span class="stringliteral">&quot;]: Reader being destroyed including: &quot;</span></div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno">  159</span>                   <span class="stringliteral">&quot;serialization containing [&quot;</span> &lt;&lt; <a class="code hl_variable" href="classipc_1_1transport_1_1struc_1_1Heap__reader.html#a86d1fba98bf24c390587893c61174111">m_serialization_segments</a>.size() &lt;&lt; <span class="stringliteral">&quot;] segments; &quot;</span></div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno">  160</span>                   <span class="stringliteral">&quot;last deserialization reports [&quot;</span> &lt;&lt; (<a class="code hl_variable" href="classipc_1_1transport_1_1struc_1_1Heap__reader.html#ab56a232e71b862b8f498d04e04450b72">m_engine</a>-&gt;sizeInWords() * <span class="keyword">sizeof</span>(::capnp::word)) &lt;&lt; <span class="stringliteral">&quot;] &quot;</span></div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno">  161</span>                   <span class="stringliteral">&quot;input heap space total.&quot;</span>);</div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno">  162</span>  }</div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno">  163</span>}</div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno">  164</span> </div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"><a class="line" href="classipc_1_1transport_1_1struc_1_1Heap__reader.html#aafa83559c9f91eabd128271c58cf2832">  165</a></span>flow::util::Blob* <a class="code hl_function" href="classipc_1_1transport_1_1struc_1_1Heap__reader.html#aafa83559c9f91eabd128271c58cf2832">Heap_reader::add_serialization_segment</a>(<span class="keywordtype">size_t</span> max_sz)</div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno">  166</span>{</div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno">  167</span>  <span class="keyword">using </span>flow::util::Blob;</div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno">  168</span> </div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno">  169</span>  <span class="keyword">const</span> <span class="keyword">auto</span> blob = <span class="keyword">new</span> Blob(get_logger(), max_sz);</div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno">  170</span>  <a class="code hl_variable" href="classipc_1_1transport_1_1struc_1_1Heap__reader.html#a86d1fba98bf24c390587893c61174111">m_serialization_segments</a>.emplace_back(blob);</div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno">  171</span> </div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno">  172</span>  FLOW_LOG_TRACE(<span class="stringliteral">&quot;Heap_reader [&quot;</span> &lt;&lt; *<span class="keyword">this</span> &lt;&lt; <span class="stringliteral">&quot;]: &quot;</span></div>
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno">  173</span>                 <span class="stringliteral">&quot;Serialization segment [&quot;</span> &lt;&lt; (<a class="code hl_variable" href="classipc_1_1transport_1_1struc_1_1Heap__reader.html#a86d1fba98bf24c390587893c61174111">m_serialization_segments</a>.size() - 1) &lt;&lt; <span class="stringliteral">&quot;] (0-based) added/owned: &quot;</span></div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno">  174</span>                 <span class="stringliteral">&quot;Heap buffer @[&quot;</span> &lt;&lt; <span class="keyword">static_cast&lt;</span><span class="keyword">const </span><span class="keywordtype">void</span>*<span class="keyword">&gt;</span>(<a class="code hl_variable" href="classipc_1_1transport_1_1struc_1_1Heap__reader.html#a86d1fba98bf24c390587893c61174111">m_serialization_segments</a>.back()-&gt;const_data()) &lt;&lt; <span class="stringliteral">&quot;] &quot;</span></div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno">  175</span>                 <span class="stringliteral">&quot;max-sized [&quot;</span> &lt;&lt; max_sz &lt;&lt; <span class="stringliteral">&quot;].&quot;</span>);</div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno">  176</span> </div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno">  177</span>  <span class="keywordflow">return</span> blob;</div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno">  178</span>}</div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno">  179</span> </div>
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"><a class="line" href="classipc_1_1transport_1_1struc_1_1Heap__reader.html#a8b1483d548bd56b3bf1e73bc46419e7a">  180</a></span>std::ostream&amp; <a class="code hl_function" href="namespaceipc_1_1transport_1_1struc.html#ae272f248d74db0486c4d9411715db15d">operator&lt;&lt;</a>(std::ostream&amp; os, <span class="keyword">const</span> <a class="code hl_class" href="classipc_1_1transport_1_1struc_1_1Heap__reader.html">Heap_reader</a>&amp; val)</div>
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno">  181</span>{</div>
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno">  182</span>  <span class="keywordflow">return</span> os &lt;&lt; <span class="charliteral">&#39;@&#39;</span> &lt;&lt; &amp;val;</div>
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno">  183</span>}</div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno">  184</span> </div>
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno">  185</span>} <span class="comment">// namespace ipc::transport::struc</span></div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno">  186</span> </div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"><a class="line" href="namespacecapnp.html">  187</a></span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespacecapnp.html">capnp</a></div>
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno">  188</span>{</div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno">  189</span> </div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"><a class="line" href="namespacecapnp.html#a8ce2ee1369a8ff7c8bd2ea75ca8af067">  190</a></span>std::ostream&amp; <a class="code hl_function" href="namespaceipc_1_1transport.html#a61c80019823537694f925275dccb4f3f">operator&lt;&lt;</a>(std::ostream&amp; os, <span class="keyword">const</span> <a class="code hl_typedef" href="namespaceipc_1_1transport_1_1struc_1_1shm_1_1classic.html#af94f8698ca62a84d6366aaa931375d41">Text::Reader</a>&amp; val)</div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno">  191</span>{</div>
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno">  192</span>  <span class="keywordflow">return</span> os &lt;&lt; val.cStr();</div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno">  193</span>}</div>
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno">  194</span> </div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno">  195</span>} <span class="comment">// namespace capnp</span></div>
<div class="ttc" id="aclassCapnp__msg__builder__interface_html"><div class="ttname"><a href="classCapnp__msg__builder__interface.html">Capnp_msg_builder_interface</a></div></div>
<div class="ttc" id="aclassipc_1_1transport_1_1struc_1_1Heap__fixed__builder__capnp__message__builder_html"><div class="ttname"><a href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder__capnp__message__builder.html">ipc::transport::struc::Heap_fixed_builder_capnp_message_builder</a></div><div class="ttdoc">A capnp::MessageBuilder used by Heap_fixed_builder: similar to a capnp::MallocMessageBuilder with the...</div><div class="ttdef"><b>Definition:</b> <a href="heap__fixed__builder__capnp__msg__builder_8hpp_source.html#l00084">heap_fixed_builder_capnp_msg_builder.hpp:86</a></div></div>
<div class="ttc" id="aclassipc_1_1transport_1_1struc_1_1Heap__fixed__builder_html"><div class="ttname"><a href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder.html">ipc::transport::struc::Heap_fixed_builder</a></div><div class="ttdoc">Implements Struct_builder concept by straightforwardly allocating fixed-size segments on-demand in th...</div><div class="ttdef"><b>Definition:</b> <a href="heap__serializer_8hpp_source.html#l00130">heap_serializer.hpp:132</a></div></div>
<div class="ttc" id="aclassipc_1_1transport_1_1struc_1_1Heap__fixed__builder_html_a0c054e351753ce326620aa1dec12d923"><div class="ttname"><a href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder.html#a0c054e351753ce326620aa1dec12d923">ipc::transport::struc::Heap_fixed_builder::payload_msg_builder</a></div><div class="ttdeci">Capnp_msg_builder_interface * payload_msg_builder()</div><div class="ttdoc">Implements concept API.</div><div class="ttdef"><b>Definition:</b> <a href="heap__serializer_8cpp_source.html#l00065">heap_serializer.cpp:65</a></div></div>
<div class="ttc" id="aclassipc_1_1transport_1_1struc_1_1Heap__fixed__builder_html_a0f8b3c876c577aa0550d13faa60e30d2"><div class="ttname"><a href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder.html#a0f8b3c876c577aa0550d13faa60e30d2">ipc::transport::struc::Heap_fixed_builder::n_serialization_segments</a></div><div class="ttdeci">size_t n_serialization_segments() const</div><div class="ttdoc">Implements concept API.</div><div class="ttdef"><b>Definition:</b> <a href="heap__serializer_8cpp_source.html#l00125">heap_serializer.cpp:125</a></div></div>
<div class="ttc" id="aclassipc_1_1transport_1_1struc_1_1Heap__fixed__builder_html_a6debedf2ddfff80f269d296c24686add"><div class="ttname"><a href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder.html#a6debedf2ddfff80f269d296c24686add">ipc::transport::struc::Heap_fixed_builder::Heap_fixed_builder</a></div><div class="ttdeci">Heap_fixed_builder()</div><div class="ttdoc">Implements concept API.</div></div>
<div class="ttc" id="aclassipc_1_1transport_1_1struc_1_1Heap__fixed__builder_html_a8f8e07a71aa5e47d6b8094b2a004cc7d"><div class="ttname"><a href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder.html#a8f8e07a71aa5e47d6b8094b2a004cc7d">ipc::transport::struc::Heap_fixed_builder::m_engine</a></div><div class="ttdeci">boost::movelib::unique_ptr&lt; Capnp_heap_engine &gt; m_engine</div><div class="ttdoc">The capnp builder engine which really does the work including owning the needed allocated segments so...</div><div class="ttdef"><b>Definition:</b> <a href="heap__serializer_8hpp_source.html#l00300">heap_serializer.hpp:300</a></div></div>
<div class="ttc" id="aclassipc_1_1transport_1_1struc_1_1Heap__fixed__builder_html_a9fb6b2727c7cc0fb8fe7d231385b5517"><div class="ttname"><a href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder.html#a9fb6b2727c7cc0fb8fe7d231385b5517">ipc::transport::struc::Heap_fixed_builder::emit_serialization</a></div><div class="ttdeci">void emit_serialization(Segment_ptrs *target_blobs, const Session &amp;session, Error_code *err_code=0) const</div><div class="ttdoc">Implements concept API.</div><div class="ttdef"><b>Definition:</b> <a href="heap__serializer_8cpp_source.html#l00072">heap_serializer.cpp:72</a></div></div>
<div class="ttc" id="aclassipc_1_1transport_1_1struc_1_1Heap__fixed__builder_html_aa670a6356fe677ae5b1e629a3964b355"><div class="ttname"><a href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder.html#aa670a6356fe677ae5b1e629a3964b355">ipc::transport::struc::Heap_fixed_builder::~Heap_fixed_builder</a></div><div class="ttdeci">~Heap_fixed_builder()</div><div class="ttdoc">Implements concept API.</div><div class="ttdef"><b>Definition:</b> <a href="heap__serializer_8cpp_source.html#l00057">heap_serializer.cpp:57</a></div></div>
<div class="ttc" id="aclassipc_1_1transport_1_1struc_1_1Heap__fixed__builder_html_ad1f2df842a49ea376749893af71a7a07"><div class="ttname"><a href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder.html#ad1f2df842a49ea376749893af71a7a07">ipc::transport::struc::Heap_fixed_builder::operator=</a></div><div class="ttdeci">Heap_fixed_builder &amp; operator=(const Heap_fixed_builder &amp;)=delete</div><div class="ttdoc">Disallow copy assignment.</div></div>
<div class="ttc" id="aclassipc_1_1transport_1_1struc_1_1Heap__fixed__builder_html_afa719b263e06eb7359b948a36f251485"><div class="ttname"><a href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder.html#afa719b263e06eb7359b948a36f251485">ipc::transport::struc::Heap_fixed_builder::m_segment_sz</a></div><div class="ttdeci">size_t m_segment_sz</div><div class="ttdoc">See ctor. We only store it to be able to emit S_INTERNAL_ERROR_SERIALIZE_LEAF_TOO_BIG in emit_seriali...</div><div class="ttdef"><b>Definition:</b> <a href="heap__serializer_8hpp_source.html#l00283">heap_serializer.hpp:283</a></div></div>
<div class="ttc" id="aclassipc_1_1transport_1_1struc_1_1Heap__reader_html"><div class="ttname"><a href="classipc_1_1transport_1_1struc_1_1Heap__reader.html">ipc::transport::struc::Heap_reader</a></div><div class="ttdoc">Implements Struct_reader concept by straightforwardly interpreting a serialization by Heap_fixed_buil...</div><div class="ttdef"><b>Definition:</b> <a href="heap__serializer_8hpp_source.html#l00324">heap_serializer.hpp:327</a></div></div>
<div class="ttc" id="aclassipc_1_1transport_1_1struc_1_1Heap__reader_html_a2dd5635aa61c4d562427b32a1266bac1"><div class="ttname"><a href="classipc_1_1transport_1_1struc_1_1Heap__reader.html#a2dd5635aa61c4d562427b32a1266bac1">ipc::transport::struc::Heap_reader::Heap_reader</a></div><div class="ttdeci">Heap_reader(const Config &amp;config)</div><div class="ttdoc">Implements concept API.</div><div class="ttdef"><b>Definition:</b> <a href="heap__serializer_8cpp_source.html#l00139">heap_serializer.cpp:139</a></div></div>
<div class="ttc" id="aclassipc_1_1transport_1_1struc_1_1Heap__reader_html_a86d1fba98bf24c390587893c61174111"><div class="ttname"><a href="classipc_1_1transport_1_1struc_1_1Heap__reader.html#a86d1fba98bf24c390587893c61174111">ipc::transport::struc::Heap_reader::m_serialization_segments</a></div><div class="ttdeci">std::vector&lt; boost::movelib::unique_ptr&lt; flow::util::Blob &gt; &gt; m_serialization_segments</div><div class="ttdoc">The actual serialization supplied so far, as divided up into segments (Blobs – byte arrays).</div><div class="ttdef"><b>Definition:</b> <a href="heap__serializer_8hpp_source.html#l00427">heap_serializer.hpp:427</a></div></div>
<div class="ttc" id="aclassipc_1_1transport_1_1struc_1_1Heap__reader_html_a88e0a260e09275c1017719028288e413"><div class="ttname"><a href="classipc_1_1transport_1_1struc_1_1Heap__reader.html#a88e0a260e09275c1017719028288e413">ipc::transport::struc::Heap_reader::~Heap_reader</a></div><div class="ttdeci">~Heap_reader()</div><div class="ttdoc">Implements concept API.</div><div class="ttdef"><b>Definition:</b> <a href="heap__serializer_8cpp_source.html#l00147">heap_serializer.cpp:147</a></div></div>
<div class="ttc" id="aclassipc_1_1transport_1_1struc_1_1Heap__reader_html_aafa83559c9f91eabd128271c58cf2832"><div class="ttname"><a href="classipc_1_1transport_1_1struc_1_1Heap__reader.html#aafa83559c9f91eabd128271c58cf2832">ipc::transport::struc::Heap_reader::add_serialization_segment</a></div><div class="ttdeci">flow::util::Blob * add_serialization_segment(size_t max_sz)</div><div class="ttdoc">Implements concept API.</div><div class="ttdef"><b>Definition:</b> <a href="heap__serializer_8cpp_source.html#l00165">heap_serializer.cpp:165</a></div></div>
<div class="ttc" id="aclassipc_1_1transport_1_1struc_1_1Heap__reader_html_ab56a232e71b862b8f498d04e04450b72"><div class="ttname"><a href="classipc_1_1transport_1_1struc_1_1Heap__reader.html#ab56a232e71b862b8f498d04e04450b72">ipc::transport::struc::Heap_reader::m_engine</a></div><div class="ttdeci">Capnp_heap_engine_ptr m_engine</div><div class="ttdoc">The capnp reader engine, as set in the deserialization() call and corresponding to the Struct::Reader...</div><div class="ttdef"><b>Definition:</b> <a href="heap__serializer_8hpp_source.html#l00445">heap_serializer.hpp:445</a></div></div>
<div class="ttc" id="aheap__serializer_8hpp_html"><div class="ttname"><a href="heap__serializer_8hpp.html">heap_serializer.hpp</a></div></div>
<div class="ttc" id="anamespacecapnp_html"><div class="ttname"><a href="namespacecapnp.html">capnp</a></div><div class="ttdoc">Small group of miscellaneous utilities to ease work with capnp (Cap'n Proto), joining its capnp names...</div><div class="ttdef"><b>Definition:</b> <a href="heap__serializer_8cpp_source.html#l00187">heap_serializer.cpp:188</a></div></div>
<div class="ttc" id="anamespaceipc_1_1transport_1_1struc_1_1error_html_a990b9ff850cf9aaf354efdd07d86a71da3deddc950bfa6d35ae03c9494eec15a6"><div class="ttname"><a href="namespaceipc_1_1transport_1_1struc_1_1error.html#a990b9ff850cf9aaf354efdd07d86a71da3deddc950bfa6d35ae03c9494eec15a6">ipc::transport::struc::error::Code::S_INTERNAL_ERROR_SERIALIZE_LEAF_TOO_BIG</a></div><div class="ttdeci">@ S_INTERNAL_ERROR_SERIALIZE_LEAF_TOO_BIG</div><div class="ttdoc">Structured message serialization (e.g., when sending over channel): A user-mutated datum (e....</div></div>
<div class="ttc" id="anamespaceipc_1_1transport_1_1struc_1_1shm_1_1classic_html_af94f8698ca62a84d6366aaa931375d41"><div class="ttname"><a href="namespaceipc_1_1transport_1_1struc_1_1shm_1_1classic.html#af94f8698ca62a84d6366aaa931375d41">ipc::transport::struc::shm::classic::Reader</a></div><div class="ttdeci">Reader&lt; ipc::shm::classic::Pool_arena &gt; Reader</div><div class="ttdoc">Convenience alias: transport::struc::shm::Reader that works with boost.ipc.shm pools from ipc::shm::c...</div><div class="ttdef"><b>Definition:</b> <a href="transport_2struc_2shm_2classic_2classic__fwd_8hpp_source.html#l00039">classic_fwd.hpp:39</a></div></div>
<div class="ttc" id="anamespaceipc_1_1transport_1_1struc_html"><div class="ttname"><a href="namespaceipc_1_1transport_1_1struc.html">ipc::transport::struc</a></div><div class="ttdoc">Sub-module of Flow-IPC module ipc::transport providing transmission of structured messages specifical...</div><div class="ttdef"><b>Definition:</b> <a href="ipc__transport__structured_2src_2ipc_2transport_2struc_2channel_8cpp_source.html#l00030">channel.cpp:31</a></div></div>
<div class="ttc" id="anamespaceipc_1_1transport_1_1struc_html_a82a69eaa39cbe8a002de1266f1cbb5cb"><div class="ttname"><a href="namespaceipc_1_1transport_1_1struc.html#a82a69eaa39cbe8a002de1266f1cbb5cb">ipc::transport::struc::Segment_ptrs</a></div><div class="ttdeci">std::vector&lt; flow::util::Blob * &gt; Segment_ptrs</div><div class="ttdoc">Sequence of 1+ Blob pointers to blobs which must stay alive while these pointers may be dereferenced,...</div><div class="ttdef"><b>Definition:</b> <a href="struc__fwd_8hpp_source.html#l00122">struc_fwd.hpp:122</a></div></div>
<div class="ttc" id="anamespaceipc_1_1transport_1_1struc_html_ac70446757444f864afa21a5062bc5b0d"><div class="ttname"><a href="namespaceipc_1_1transport_1_1struc.html#ac70446757444f864afa21a5062bc5b0d">ipc::transport::struc::NULL_SESSION</a></div><div class="ttdeci">const Null_session NULL_SESSION</div><div class="ttdoc">The only necessary value of empty-type Null_session.</div><div class="ttdef"><b>Definition:</b> <a href="heap__serializer_8cpp_source.html#l00035">heap_serializer.cpp:35</a></div></div>
<div class="ttc" id="anamespaceipc_1_1transport_1_1struc_html_ae272f248d74db0486c4d9411715db15d"><div class="ttname"><a href="namespaceipc_1_1transport_1_1struc.html#ae272f248d74db0486c4d9411715db15d">ipc::transport::struc::operator&lt;&lt;</a></div><div class="ttdeci">std::ostream &amp; operator&lt;&lt;(std::ostream &amp;os, const Heap_fixed_builder &amp;val)</div><div class="ttdoc">Prints string representation of the given Heap_fixed_builder to the given ostream.</div><div class="ttdef"><b>Definition:</b> <a href="heap__serializer_8cpp_source.html#l00132">heap_serializer.cpp:132</a></div></div>
<div class="ttc" id="anamespaceipc_1_1transport_html_a61c80019823537694f925275dccb4f3f"><div class="ttname"><a href="namespaceipc_1_1transport.html#a61c80019823537694f925275dccb4f3f">ipc::transport::operator&lt;&lt;</a></div><div class="ttdeci">std::ostream &amp; operator&lt;&lt;(std::ostream &amp;os, const Bipc_mq_handle &amp;val)</div><div class="ttdoc">Prints string representation of the given Bipc_mq_handle to the given ostream.</div><div class="ttdef"><b>Definition:</b> <a href="bipc__mq__handle_8cpp_source.html#l01029">bipc_mq_handle.cpp:1029</a></div></div>
<div class="ttc" id="anamespaceipc_1_1util_html_ae0be7edba7e30ffa3f8b742af621f2ab"><div class="ttname"><a href="namespaceipc_1_1util.html#ae0be7edba7e30ffa3f8b742af621f2ab">ipc::util::Blob_const</a></div><div class="ttdeci">boost::asio::const_buffer Blob_const</div><div class="ttdoc">Short-hand for an immutable blob somewhere in memory, stored as exactly a void const * and a size_t.</div><div class="ttdef"><b>Definition:</b> <a href="util__fwd_8hpp_source.html#l00134">util_fwd.hpp:134</a></div></div>
<div class="ttc" id="anamespaceipc_html_a4ccdeed058222c635745a4dc830e99f7"><div class="ttname"><a href="namespaceipc.html#a4ccdeed058222c635745a4dc830e99f7">ipc::Log_component</a></div><div class="ttdeci">Log_component</div><div class="ttdoc">The flow::log::Component payload enumeration containing various log components used by Flow-IPC inter...</div><div class="ttdef"><b>Definition:</b> <a href="common_8hpp_source.html#l00322">common.hpp:323</a></div></div>
<div class="ttc" id="anamespaceipc_html_aa3192e586cc45d3e7c22463bf2760f89"><div class="ttname"><a href="namespaceipc.html#aa3192e586cc45d3e7c22463bf2760f89">ipc::Error_code</a></div><div class="ttdeci">flow::Error_code Error_code</div><div class="ttdoc">Short-hand for flow::Error_code which is very common.</div><div class="ttdef"><b>Definition:</b> <a href="common_8hpp_source.html#l00298">common.hpp:298</a></div></div>
<div class="ttc" id="astructipc_1_1transport_1_1struc_1_1Heap__fixed__builder_1_1Config_html"><div class="ttname"><a href="structipc_1_1transport_1_1struc_1_1Heap__fixed__builder_1_1Config.html">ipc::transport::struc::Heap_fixed_builder::Config</a></div><div class="ttdoc">Implements Struct_builder::Config sub-concept.</div><div class="ttdef"><b>Definition:</b> <a href="heap__serializer_8hpp_source.html#l00154">heap_serializer.hpp:155</a></div></div>
<div class="ttc" id="astructipc_1_1transport_1_1struc_1_1Heap__reader_1_1Config_html"><div class="ttname"><a href="structipc_1_1transport_1_1struc_1_1Heap__reader_1_1Config.html">ipc::transport::struc::Heap_reader::Config</a></div><div class="ttdoc">Implements Struct_reader::Config sub-concept.</div><div class="ttdef"><b>Definition:</b> <a href="heap__serializer_8hpp_source.html#l00332">heap_serializer.hpp:333</a></div></div>
<div class="ttc" id="astructipc_1_1transport_1_1struc_1_1Heap__reader_1_1Config_html_aad4ca0248c1ac0c869ab6033d1d43bed"><div class="ttname"><a href="structipc_1_1transport_1_1struc_1_1Heap__reader_1_1Config.html#aad4ca0248c1ac0c869ab6033d1d43bed">ipc::transport::struc::Heap_reader::Config::m_n_segments_est</a></div><div class="ttdeci">size_t m_n_segments_est</div><div class="ttdoc">Best guess for how many times you expect to call add_serialization_segment(); or 0 if you have no gue...</div><div class="ttdef"><b>Definition:</b> <a href="heap__serializer_8hpp_source.html#l00349">heap_serializer.hpp:349</a></div></div>
<div class="ttc" id="astructipc_1_1transport_1_1struc_1_1Null__session_html"><div class="ttname"><a href="structipc_1_1transport_1_1struc_1_1Null__session.html">ipc::transport::struc::Null_session</a></div><div class="ttdoc">Value for Struct_builder::Session when no extra information is needed when serializing Struct_builder...</div><div class="ttdef"><b>Definition:</b> <a href="heap__serializer_8hpp_source.html#l00045">heap_serializer.hpp:45</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu May 2 2024 23:56:38 for Flow-IPC by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.4
</small></address>
</body>
</html>
